package project.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import project.DAO.homepageDAO;

import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

@Controller
public class homepage {
    @Autowired
    homepageDAO homepageDao;
    @RequestMapping("/homepage")
    String homepage( Map map)
    {
        java.util.Date day=new Date();
        SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time=sdf.format(day);
       int ic1=homepageDao.selectTouch(time);
       map.put("ic1",ic1);
       int ic2=homepageDao.selectAll();
       map.put("ic2",ic2);
       int definite1=homepageDao.selectDefinite();
       map.put("definite1",definite1);
       int definite2=homepageDao.selectAll1();
       map.put("definite2",definite2);
       int materials1=homepageDao.select();
       map.put("materials1",materials1);
       int materials2=homepageDao.selectsum();
       map.put("materials2",materials2);
       int volunteer1=homepageDao.selectvolunteer();
       map.put("volunteer1",volunteer1);
        map.put("volunteer2",volunteer1);
        int doctor1=homepageDao.selectDoctor();
        map.put("doctor1",doctor1);
        map.put("doctor2",doctor1);
        int out1=homepageDao.selectIsolate();
        map.put("out1",out1);
        int out2=homepageDao.selectIsolate1();
        map.put("out2",out2);
        return "homepage";
    }
}
